﻿package chapter_07_Homework;

import java.util.Scanner;

/*
 * 		判断数组中是否包含输入值。
 */
public class Work_04 {
	public static void main(String[] args) {
		int[] scores = new int[]{89,43,135,26,85,49};
		boolean isRight = false;
		System.out.print("数组是：");
		for (int i = 0; i < scores.length; i++) {
			System.out.print(scores[i]+" ");
		}
		System.out.print("\n请输入一个整数：");
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		for (int i = 0; i < scores.length; i++) {
			if(num==scores[i]){
				isRight = true;
				System.out.println("Beautiful,you are right!");
				break;
			}
		}
		if(!isRight){
			System.out.println("Sorry,you are wrong!");
		}
	}
}
